/**
 * @file camera.h
 *
 */
#ifndef CAMERA_H
#define CAMERA_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_ex_conf.h"
#else
#include "/lvgl/lvgl.h"
#include "../../../lv_ex_conf.h"
#endif

#if USE_LV_WATCH_CAMERA != 0

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/
typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;
    /*New data for this type */
    lv_obj_t * img;
    lv_obj_t * cont;
    hal_rtc_t time;
    TIMER_ID timer;
} lv_camera_obj_ext_t;

/**********************
 * GLOBAL PROTOTYPES
 **********************/
lv_obj_t * camera_create(lv_obj_t * activity_obj);
void camera_create_btn_event_cb(lv_obj_t * btn, lv_event_t e);
void camera_start_from_album(void);

/**********************
 *      MACROS
 **********************/
#if BUILD_IN_PC_SIMULATOR
#define CRANE_CAMERA_ERROR_NONE             0
#define CRANE_CAMERA_ERROR_BADPOINTER       1001
#define CRANE_CAMERA_ERROR_BADARGUMENT      1002
#define CRANE_CAMERA_ERROR_INVALIDOPERATION 1003
#define CRANE_CAMERA_ERROR_OUTOFMEMORY      1004
#define CRANE_CAMERA_ERROR_NOTFOUND         1006
#define CRANE_CAMERA_ERROR_NOTSUPPORT       1007
#define CRANE_CAMERA_ERROR_TIMEOUT          1008
#define CRANE_CAMERA_ERROR_DEVICEWASOPENED  1009
#define CRANE_CAMERA_ERROR_FATALERROR       1010
#endif

#endif /*USE_LV_WATCH_CAMERA*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*CAMERA_H*/
